<% var rowsOnly = (rowsOnly != 'undefined' && rowsOnly) %>
<% if (!rowsOnly) { %>
<h4><%= header %> <span id="pagination-info"><%= paginationString %></span></h4>

<div data-role="controlgroup" data-type="horizontal">
	<a id="day-btn" class="calendar_view_type_btn" data-role="button" <% if (viewType == 'day') print('data-theme="b"') %> ><%= helper.string('Day') %></a>
	<a id="week-btn" class="calendar_view_type_btn" data-role="button" <% if (viewType == 'week') print('data-theme="b"') %> ><%= helper.string('Week') %></a>
</div>
<br style="clear: both;">

<ul data-role="listview" data-theme="a" id="list-view" class="list-view-with-icons">
	<% } %>
	<% if (collection.length > 0) { %>
	<%
	_.each(collection.models, function(model, key) {
	%>	
	<li>
		<a href="#<%= model.get('moduleName') %>/detail/<%= model.get('id') %>" data-icon="module-<%= model.get('moduleName').toLowerCase() %>">
			<img src="<%= App.sugarUrl %>index.php?entryPoint=getImage&imageName=icon_<%= model.get('moduleName') %>_32.gif" class="ui-li-icon ui-big-thumb">
		<h5>											
		<%= model.get('name') %>&nbsp;
		</h5>					
		<p>											
		<%
			var field = 'date_start';
			if (model.get('moduleName') == 'Tasks') {
				field = 'date_due'; 
			}
			print(helper.getDateTime().convertToDisplay(model.get(field)));
		%>
		&nbsp;
		</p>					
		<p>											
		<%= helper.language.translateEnum(model.get('status'), statusDoms[model.get('moduleName')] ) %>&nbsp;
		</p>					
		<a data-icon="arrow-r" href="#<%= model.get('moduleName') %>/edit/<%= model.get('id') %>" data-theme="c"><%= helper.string('Edit') %></a>
		</a>
	</li>
	<% }); %>
	<% } else { %>
	<li> <%= helper.string('No Result') %></li>
	<% } %>
	<% if (!rowsOnly) { %>
</ul>
<% } %>
